function getQueryString(name) {
    var svalue  = location.href.match(new RegExp("[\?\&]" + name + "=([^\&]*)(\&?)","i"));
    return svalue ? svalue[1] : svalue;
}
angular.module('notificationview.controller', [])
  .controller('notificationviewCtrl', ['$scope', '$timeout', '$localstorage', '$ionicPopup', 'notificationviewService', '$state', 'loginService', '$ionicHistory', function ($scope, $timeout, $localstorage, $ionicPopup, newsviewService, $state, loginService, $ionicHistory) {

      $scope.params = {};
      $scope.nitificationInfo = {};
      $scope.params = newsviewService.getParams();
      $scope.visible = true; //初始
      $scope.$on('$ionicView.enter', function (event, data) {
          var id = getQueryString('id');
          newsviewService.get_notificationviewInfo(id).then(function (data) {
              $scope.nitificationInfo = data;
              $('#viewcent').html(data.Content);
          }, function (error) {
              var alertPopup = $ionicPopup.alert({
                  title: '获取在网导航失败！',
                  template: "异常错误",
                  okText: '确定', // String (默认: 'OK')。OK按钮的文字。
                  okType: 'item-customer-bg-darkred', // String (默认: 'button-positive')。OK按钮的类型。
              });
          });
      });
      $scope.goBack = function () {
          $ionicHistory.goBack(-1);//back到之前的路由
      }
  }]);
